package com.weasel.weixin.commons.menu.bean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Dylan on 2015/10/8.
 */
public class Menu {

    private final static int BUTTON_COUNT = 3;

    private List<Button> button = new ArrayList<>();

    public List<Button> getButton() {
        return button;
    }

    public void setButton(List<Button> button) {
        this.button = button;
    }

    public Menu addButton(Button _button){

        if(button.size() > BUTTON_COUNT){
            throw new RuntimeException("最多能添加3个一级菜单");
        }
        button.add(_button);
        return this;
    }
}
